package com.jhm.ai.util;

import java.net.HttpURLConnection;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

public class HttpConnectionManager {
    private static final Map<String, HttpURLConnection> responseMap = new ConcurrentHashMap<>();

    public static String generateRequestId() {
        return UUID.randomUUID().toString();
    }

    public static void addConnection(String requestId, HttpURLConnection response) {
        responseMap.put(requestId, response);
    }

    public static HttpURLConnection getConnection(String requestId) {
        return responseMap.get(requestId);
    }

    public static void removeConnection(String requestId) {
        responseMap.remove(requestId);
    }
} 